package com.cdn.allmobilestore.object;

import org.json.JSONException;
import org.json.JSONObject;

import com.cdn.allmobilestore.ulti.Constant;

public class Category {

	private String id;
	private String name;
	private int downloadTimes;
	private int num;
	private String iconLink;

	public Category(String id, String name, int downloadTimes, int num,
			String iconLink) {
		super();
		this.id = id;
		this.name = name;
		this.downloadTimes = downloadTimes;
		this.num = num;
		this.iconLink = iconLink;
	}

	public Category(JSONObject json) {
		super();
		try {
			this.id = json.getString(Constant.id);
			this.name = json.getString(Constant.name);
			this.downloadTimes = json.getInt(Constant.downloadNum);
			this.num = json.getInt(Constant.quantity);
			this.iconLink = json.getString(Constant.iconLink);
		} catch (JSONException e) {
			e.printStackTrace();
		}
	}

	public Category() {
		// TODO Auto-generated constructor stub
	}

	@Override
	public String toString() {
		return "Catagory [id=" + id + ", name=" + name + ", downloadTimes="
				+ downloadTimes + ", num=" + num + ", iconLink=" + iconLink
				+ "]";
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getDownloadTimes() {
		return downloadTimes;
	}

	public void setDownloadTimes(int downloadTimes) {
		this.downloadTimes = downloadTimes;
	}

	public int getNum() {
		return num;
	}

	public void setNum(int num) {
		this.num = num;
	}

	public String getIconLink() {
		return iconLink;
	}

	public void setIconLink(String iconLink) {
		this.iconLink = iconLink;
	}

}
